package com.pachong.service.impl;

import com.domain.bean.music.Song;
import com.pachong.common.impl.BaseServiceImpl;
import com.pachong.service.SongService;
import com.wy.dao.music.SongDAO;
import com.wy.dao.sys.BaseDAO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author : wangyu
 * Date: 2018-03-05
 * Time: 14:28
 */
@Service
public class SongServiceImpl  extends BaseServiceImpl<Song,Integer> implements SongService {

    @Autowired
    private SongDAO songDAO;

    @Override
    public BaseDAO<Song, Integer> getBaseDao() {
        return songDAO;
    }

    @Override
    public Song findByCode(String code) {
        if(StringUtils.isBlank(code)){
            return null;
        }
        return songDAO.findByCode(code);
    }

    @Override
    public List<Song> selectSong(Integer time) {
        return songDAO.selectSong(time);
    }
}
